package shujia.day16.factoryFunction;

/*
    工厂方法模式：
        1、好处是不需要频繁的修改类中的内容
        2、代码文件数量变多
 */
public class Demo1 {
    public static void main(String[] args) {
        //养一只🐱
        CatFactory catFactory = new CatFactory();
        Animal c1 = catFactory.createAnimal(); // new Cat()
        Animal c2 = catFactory.createAnimal(); // new Cat()
        Animal c3 = catFactory.createAnimal(); // new Cat()

        TigerFactory tigerFactory = new TigerFactory();
        Animal t1 = tigerFactory.createAnimal();
        Animal t2 = tigerFactory.createAnimal();
        Animal t3 = tigerFactory.createAnimal();
    }
}
